<?php
function poiCellRender($cell, $data){
	switch($cell->getColumn()->getName()){
		case 'business_phone':
		case 'mobile':
			return str_replace(',', '<br/>', $cell->getCellText());
//		case 'map_status':
//			if(empty($data['map_status'])){
//				return '<a href="'.Kd_Web::getRouter()->buildActionUrl(array('poiid'=>$data['id']), 'create', 'map').'"><span>'.Kd_Localize_Helper::__('share.button.create').'</span></a>';
//			}else{
//				$status = Kd_Localize_Helper::getLanguageItems('status.publication');
//				return '<a href="'.$cell->getCellLinkUrl().'"><span>'.$status[$cell->getCellText()].'</span></a>';
//			}
//			if(!$data['map_status']){
//				$cell->setUrl(Kd_Web::getRouter()->buildActionUrl(array('poiid'=>'{id}'), 'create', 'map'))
//					 ->setText(Kd_Localize_Helper::__('share.button.create'));
//			}else{
//				$mapStatus = $cell->getCellText();
//				$status = Kd_Localize_Helper::getLanguageItems('status.publication');
//				$cell->setText($status[$mapStatus]);
//			}
//			break;
//		case 'shop_status':
//			if(empty($data['shop_status'])){
//				return '<a href="'.Kd_Web::getRouter()->buildActionUrl(array('poiid'=>$data['id']), 'create', 'shop').'"><span>'.Kd_Localize_Helper::__('share.button.create').'</span></a>';
//			}else{
//				$status = Kd_Localize_Helper::getLanguageItems('status.publication');
//				return '<a href="'.$cell->getCellLinkUrl().'"><span>'.$status[$cell->getCellText()].'</span></a>';
//			}
//		case 'edit':
//			if(isset($data['poi_id'])){
//				$cell->setUrl(Kd_Web::getRouter()->buildActionUrl(array('id'=>'{id}'), 'edit'))
//					 ->setText(Kd_Localize_Helper::__('share.button.edit'));
//			}
//			break;
//		case 'product':
//		case 'concessions':
//			if(!isset($data['shop_status'])){
//				return '';
//			}
//			break;
	}
	return FALSE;
}
$this->grid->setCellRender(poiCellRender);
$this->setLayout('template'.DS.'default.phtml');

$this->startBlock('topbar');
echo $this->navigation->toHtml();
$this->endBlock();

$this->startBlock();
echo $this->loadTemplate('share'.DS.'grid.phtml', array('grid'=>$this->grid, 'pagination'=>$this->pagination, 'toolbar'=>$this->toolbar));
$this->endBlock();

$this->startBlock('bottombar');
echo $this->pagination->toHtml();
$this->endBlock();